package org.fantasmerica.model.trigger;

import org.fantasmerica.model.DamageType;
import org.fantasmerica.model.character.Combatant;

public class PoisonedTrigger
		extends BeginningOfTurnTrigger {

	double damagePerTurn;
	int triggerDuration;

	public PoisonedTrigger(double damagePerTurn, int triggerDuration) {
		setRemoveAfterCombat(true);
		this.damagePerTurn = damagePerTurn;
		this.triggerDuration = triggerDuration;
	}

	@Override
	public void execute(Combatant me, Combatant enemy) {
		// TODO Auto-generated method stub
		me.causeDamage(damagePerTurn, DamageType.POISON);
		if (--triggerDuration == 1) {
			me.removeTrigger(this);
		}
	}

}
